using System;
using System.Xml.Schema;
using System.Xml.Serialization;
using flickr.api.communication;

namespace flickr.api
{
    [Serializable]
    public class PhotoDates : FlickrObject
    {
        public PhotoDates():base(){}
        public PhotoDates(FlickrConnection connection) : base(connection){}
        
        [XmlIgnore]
        public DateTime PostedDate
        {
            get { return Utilities.UnixTimestampToDate(posted); }
        }

        [XmlAttribute("posted", Form=XmlSchemaForm.Unqualified)]
        public int posted;

        [XmlIgnore]
        public DateTime TakenDate
        {
            get { return DateTime.Parse(taken); }
        }

        [XmlAttribute("taken", Form=XmlSchemaForm.Unqualified)]
        public string taken;

        [XmlAttribute("takengranularity", Form=XmlSchemaForm.Unqualified)]
        public int TakenGranularity;

        [XmlAttribute("lastupdate", Form = XmlSchemaForm.Unqualified)]
        public string lastupdate;

    }
}